fix(deps): update dependency parse-server to v5 [security] - autoclosed #551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.4.0
->5.5.6
GitHub Vulnerability Alerts
CVE-2020-26288
Parse Server is an open source backend that can be deployed to any infrastructure that can run Node.js.
In Parse Server before version 4.5.0, user passwords involved in LDAP authentication are stored in cleartext.
This is fixed in version 4.5.0 by stripping password after authentication to prevent cleartext password storage.
CVE-2021-39187
Impact
Parse Server crashes when if a query request contains an invalid value for the
explain
option. This is due to a bug in the MongoDB Node.js driver which throws an exception that Parse Server cannot catch.Patches
Upgrade to Parse Server 4.10.3
CVE-2021-39138
Impact
Developers that use the REST API to signup users and also allow users to login anonymously. When an anonymous user is first signed up using REST, the server creates session incorrectly, particularly the
authProvider
field in_Session
class undercreatedWith
shows the user logged in creating a password. If a developer later depends on thecreatedWith
field to provide a different level of access between a password user and anonymous user, the server incorrectly classified the session type as being created with apassword
.The server currently doesn't use
createdWith
to make decisions on how things work internally, so if a developer isn't usingcreatedWith
directly, there's nothing to worry about. The vulnerability only affects users who depend oncreatedWith
by using it directly.Patches
Upgrade to version 4.5.1.
Workarounds
Don't use the
createdWith
Session field to make decisions if you allow anonymous login.References
n/a
GHSA-593v-wcqx-hq2w
Impact
A security incident caused a number of incorrect version tags to be pushed to the Parse Server repository. These version tags linked to a personal fork of a contributor who had write access to the repository. The code to which these tags linked has not been reviewed or approved by Parse Platform. Even though no releases were published with these incorrect versions, it was possible to define a Parse Server dependency that pointed to these version tags, for example if you defined this dependency:
We have since deleted the incorrect version tags, but they may still show up in your personal fork on GitHub or locally. We do not know when these tags have been pushed to the Parse Server repository, but we first became aware of this issue on July 21, 2021. We are not aware of any malicious code or concerns related to privacy, security or legality (e.g. proprietary code). However, it has been reported that some functionality does not work as expected and the introduction of security vulnerabilities cannot be ruled out.
You may be also affected if you used the Bitnami image for Parse Server. Bitnami picked up the incorrect version tag
4.9.3
and published a new Bitnami image for Parse Server.If you are using any of the affected versions, we urgently recommend to upgrade to version
4.10.0
.These are the incorrect tags:
Patches
Upgrade to version
4.10.0
.Workarounds
Downgrade to version
4.5.2
.References
n/a
CVE-2021-41109
Impact
For regular (non-LiveQuery) queries, the session token is removed from the response, but for LiveQuery payloads it is currently not. If a user has a LiveQuery subscription on the
Parse.User
class, all session tokens created during user sign-ups will be broadcast as part of the LiveQuery payload.Patches
Remove session token from LiveQuery payload.
Workaround
Set
user.acl(new Parse.ACL())
in a beforeSave trigger to make the user private already on sign-up.CVE-2022-24760
Impact
This is a Remote Code Execution (RCE) vulnerability in Parse Server. This vulnerability affects Parse Server in the default configuration with MongoDB. The main weakness that leads to RCE is the Prototype Pollution vulnerable code in the file
DatabaseController.js
, so it is likely to affect Postgres and any other database backend as well. This vulnerability has been confirmed on Linux (Ubuntu) and Windows.Patches
Upgrade to Parse Server >=4.10.7. If you are using a prerelease version of Parse Server 5.0 (alpha, beta) we will publish a timely fix for these. However, as a general reminder we do not consider prerelease versions to be suitable for production deployment.
Note that as part of the fix a new security feature scans for sensitive keywords in request data to prevent JavaScript prototype pollution. If such a keyword is found, the request is rejected with HTTP response code
400
and Parse Error105
(INVALID_KEY_NAME
). By default these keywords are:{_bsontype: "Code"}
,constructor
,__proto__
. If you are using any of these keywords in your request data, you can override the default keywords by setting the new Parse Server optionrequestKeywordDenylist
to[]
and specify your own keywords as needed.Workarounds
Although the fix is more broad and includes several aspects of the vulnerability, a quick and targeted fix can be achieved by patching the MongoDB Node.js driver and disable BSON code execution. To apply the patch, add the following code to be executed before starting Parse Server, for example in
index.js
.References
CVE-2022-24901
Impact
Weak validation of the Apple certificate URL in the Apple Game Center authentication adapter allows to bypass authentication and makes the server vulnerable to DoS attacks.
Patches
The vulnerability has been fixed by improving the URL validation and adding additional checks of the resource the URL points to before downloading it.
CVE-2022-31083
Impact
The certificate in Apple Game Center auth adapter not validated. As a result, authentication could potentially be bypassed by making a fake certificate accessible via certain Apple domains and providing the URL to that certificate in an authData object.
Patches
To prevent this, a new
rootCertificateUrl
property is introduced to the Parse Server Apple Game Center auth adapter which takes the URL to the root certificate of Apple's Game Center authentication certificate. If no value is set, therootCertificateUrl
property defaults to the URL of the current root certificate as of May 27, 2022.Keep in mind that the root certificate can change at any time (expected to be announced by Apple) and that it is the developer's responsibility to keep the root certificate URL up-to-date when using the Parse Server Apple Game Center auth adapter.
Workarounds
None.
References
More information
CVE-2022-31089
Impact
Certain types of invalid files requests are not handled properly and can crash the server. If you are running multiple Parse Server instances in a cluster, the availability impact may be low; if you are running Parse Server as a single instance without redundancy, the availability impact may be high.
Patches
To prevent this, invalid requests are now properly handled.
Workarounds
None
References
For more information
CVE-2022-31112
Impact
Parse Server LiveQuery does not remove protected fields in classes, passing them to the client.
Patches
The LiveQueryController now removes protected fields from the client response.
Workarounds
Use
Parse.Cloud.afterLiveQueryEvent
to manually remove protected fields.References
For more information
If you have any questions or comments about this advisory:
CVE-2022-36079
Impact
Internal fields (keys used internally by Parse Server, prefixed by
_
) and protected fields (user defined) can be used as query constraints. Internal and protected fields are removed by Parse Server from query results and are only returned to the client using a valid master key. However, using query constraints, these fields can be guessed by enumerating until Parse Server returns a response object.Patches
The patch requires the master key to use internal and protected fields as query constraints.
Workarounds
Implement a Parse Cloud Trigger
beforeFind
and manually remove the query constraints, such as:References
CVE-2022-39225
Impact
A foreign user can write to the session object of another user if the session object ID is known. For example, a foreign user can assign the session object to their own user by writing to the
user
field and then read any custom fields of that session object.Note that assigning a session to a foreign user does not usually change the privileges of neither of the two users, according to how Parse Server uses session objects internally. However, if custom logic is used to relate specific session objects to privileges this vulnerability may have a higher level of severity.
The vulnerability does not allow a foreign user to assign a session object to themselves, read the session token, and then reassign the session object to the original user to then authenticate as that user with the known session token. The vulnerability only exists for foreign session objects, a user cannot assign their own session to another user.
While it is unlikely that the session object ID of another user is known, it is possible to brute-force guess an object ID, even though the attacker would not know to which user a successfully guessed session object ID belongs.
Patches
The fix prevents writing to foreign session objects, even if the session object ID is known.
Workarounds
Add a
beforeSave
trigger to the_Session
class and prevent writing if the requesting user is different from the user in the session object.References
CVE-2022-39231
Impact
Validation of the authentication adapter app ID for Facebook and Spotify may be circumvented.
This fixes a vulnerability that affects configurations which allow users to authenticate using the Parse Server authentication adapter for Facebook or Spotify and where the server-side authentication adapter configuration
appIds
is set as a string (e.g.abc
) instead of an array of strings (e.g.["abc"]
). The vulnerability makes it possible to authenticate requests which are coming from a Facebook or Spotify app with a different app ID than the one specified in theappIds
configuration.Both adapters still validate the access token with the respective authentication provider. An app ID is automatically assigned by the authentication provider. For this vulnerability to be exploited, an attacker would have to be assigned an app ID by the authentication provider which is a sub-set of the server-side configured app ID.
The documentation did not explicitly specify that the parameter
appIds
must be set as an array of strings and setting a string also worked. Therefore, there is a possibility that there are deployments whereappIds
is set as a string, making them vulnerable.Patches
The fix makes Parse Server check the type of the value set for
appIds
and throws an error if the value is not an array.Workarounds
No known workarounds.
References
CVE-2022-39313
Impact
Parse Server crashes when a file download request is received with an invalid byte range.
Patches
Improved parsing of the range parameter to properly handle invalid range requests.
Workarounds
None
References
CVE-2022-39396
Impact
An attacker can use this prototype pollution sink to trigger a remote code execution through the MongoDB BSON parser.
Patches
Prevent prototype pollution in MongoDB database adapter.
Workarounds
Disable remote code execution through the MongoDB BSON parser.
Collaborators
Mikhail Shcherbakov (KTH), Cristian-Alexandru Staicu (CISPA) and Musard Balliu (KTH) working with Trend Micro Zero Day Initiative
References
CVE-2022-41878
Impact
Keywords that are specified in the Parse Server option
requestKeywordDenylist
can be injected via Cloud Code Webhooks or Triggers. This will result in the keyword being saved to the database, bypassing therequestKeywordDenylist
option.Patches
Improved keyword detection.
Workarounds
Configure your firewall to only allow trusted servers to make request to the Parse Server Cloud Code Webhooks API, or block the API completely if you are not using the feature.
Collaborators
Mikhail Shcherbakov, Cristian-Alexandru Staicu and Musard Balliu working with Trend Micro Zero Day Initiative
References
CVE-2022-41879
Impact
A compromised Parse Server Cloud Code Webhook target endpoint allows an attacker to use prototype pollution to bypass the Parse Server
requestKeywordDenylist
option.Patches
Improved keyword detection.
Workarounds
None.
Collaborators
Mikhail Shcherbakov, Cristian-Alexandru Staicu and Musard Balliu working with Trend Micro Zero Day Initiative
References
CVE-2023-22474
Impact
Parse Server uses the request header
x-forwarded-for
to determine the client IP address. If Parse Server doesn't run behind a proxy server, then a client can set this header and Parse Server will trust the value of the header. The incorrect client IP address will be used by various features in Parse Server. This allows to circumvent the security mechanism of the Parse Server optionmasterKeyIps
by setting an allowed IP address as thex-forwarded-for
header value.Patches
The mechanism to determine the client IP address has been rewritten. The correct IP address determination now requires to set the Parse Server option
trustProxy
accordingly, see the express framework's trust proxy setting.References
CVE-2023-32689
Impact
Phishing attack vulnerability by uploading malicious files. A malicious user could upload a HTML file to Parse Server via its public API. That HTML file would then be accessible at the internet domain at which Parse Server is hosted. The URL of the the uploaded HTML could be shared for phishing attacks. The HTML page may seem legitimate because it is served under the internet domain where Parse Server is hosted, which may be the same as a company's official website domain.
An additional security issue arises when the Parse JavaScript SDK is used. The SDK stores sessions in the internet browser's local storage, which usually restricts data access depending on the internet domain. A malicious HTML file could contain a script that retrieves the user's session token from local storage and then share it with the attacker.
Patches
The fix adds a new Parse Server option
fileUpload.fileExtensions
to restrict file upload on Parse Server by file extension. It is recommended to restrict file upload for HTML file extensions, which this fix disables by default. If an app requires upload of files with HTML file extensions, the option can be set to['.*']
or another custom value to override the default.References
CVE-2023-36475
Impact
An attacker can use this prototype pollution sink to trigger a remote code execution through the MongoDB BSON parser.
Patches
Prevent prototype pollution in MongoDB database adapter.
Workarounds
Disable remote code execution through the MongoDB BSON parser.
Credits
References
CVE-2023-41058
Impact
A Parse Pointer can be used to access internal Parse Server classes. It can also be used to circumvent the
beforeFind
query trigger which can be an additional vulnerability for deployments where thebeforeFind
trigger is used as a security layer to modify an incoming query.Patches
The vulnerability was fixed by implementing a patch in the internal query pipeline to prevent a Parse Pointer to be used to access internal Parse Server classes or circumvent the
beforeFind
trigger.Workarounds
There is no known workaround to prevent a Parse Pointer to be used to access internal Parse Server classes. A workaround if a
beforeFind
trigger is used as a security layer is to instead use the Parse Server provided security layers to manage access levels with Class-Level Permissions and Object-Level Access Control.References
CVE-2023-46119
Impact
Parse Server crashes when uploading a file without extension.
Patches
A permanent fix has been implemented to prevent the server from crashing.
Workarounds
There are no known workarounds.
References
Release Notes
parse-community/parse-server (parse-server)
v5.5.6
Compare Source
Bug Fixes
v5.5.5
Compare Source
Bug Fixes
beforeFind
query trigger; fixes security vulnerability GHSA-fcv6-fg5r-jm9q (6458ab0) (#8732)v5.5.4
Compare Source
Bug Fixes
v5.5.3
Compare Source
Bug Fixes
auth
option is set (#8669) (601da1e)v5.5.2
Compare Source
Bug Fixes
v5.5.1
Compare Source
Bug Fixes
v5.5.0
Compare Source
Features
fileUpload.fileExtensions
to restrict file upload by file extension; this fixes a security vulnerability in which a phishing attack could be performed using an uploaded HTML file; by default the new option only allows file extensions matching the regex pattern^[^hH][^tT][^mM][^lL]?$
, which excludes HTML files; if your app currently depends on uploading files with HTML file extensions then this may be a breaking change and you could allow HTML file upload by setting the option to['.*']
(#8537) (196e05f)v5.4.3
Compare Source
Bug Fixes
beforeSave
hook exists (#8474) (4f0f0ec)v5.4.2
Compare Source
Bug Fixes
v5.4.1
Compare Source
Bug Fixes
trustProxy
accordingly if Parse Server runs behind a proxy server, see the express framework's trust proxy setting; this fixes a security vulnerability in which the Parse Server optionmasterKeyIps
may be circumvented, see GHSA-vm5r-c87r-pf6x (#8369) (e016d81)v5.4.0
Compare Source
Bug Fixes
equalTo
with valuefalse
(#8032) (7f5a15d)_Idempotency
and_Role
are not protected in defined schema (#8121) (c16f529)containedIn
not working when object field is an array (#8128) (1d9605b)badge
doesn't update with Installation beforeSave trigger (#8162) (3c75c2b)Date
whendirectAccess: true
(#8167) (e424137)Parse.Query.or
,Parse.Query.and
not working (#8203) (28f0d26)INVALID_SERVER_ERROR
on Postgres (#8157) (3b775a1)Features
Parse.Server
(#8244) (9f11115)Parse.Query.limit()
constraint (#8152) (0388956)v5.3.3
Compare Source
Bug Fixes
v5.3.2
Compare Source
Bug Fixes
requestKeywordDenylist
can be bypassed via Cloud Code Webhooks or Triggers; fixes security vulnerability GHSA-xprv-wvh7-qqqx (#8302) (6728da1)v5.3.1
Compare Source
Bug Fixes
v5.3.0
Compare Source
Bug Fixes
allowClientClassCreation
defaulting totrue
(#7925) (38ed96a)Unexpected Error
(#8045) (0d81887)Features
Parse.Cloud.beforeSave(Parse.File, (request) => {})
, the old syntaxParse.Cloud.beforeSaveFile((request) => {})
has been deprecated (#7966) (c6dcad8)Performance Improvements
v5.2.8
Compare Source
Bug Fixes
v5.2.7
Compare Source
Bug Fixes
appIds
is set as a string (e.g.abc
) instead of an array of strings (e.g.["abc"]
) (GHSA-r657-33vp-gp22) (#8185) (ecf0814)v5.2.6
Compare Source
Bug Fixes
v5.2.5
Compare Source
Bug Fixes
v5.2.4
Compare Source
Bug Fixes
v5.2.3
Compare Source
Bug Fixes
v5.2.2
Compare Source
Bug Fixes
v5.2.1
Compare Source
Bug Fixes
v5.2.0
Compare Source
Bug Fixes
Features
v5.1.1
Compare Source
Reverts
v5.1.0
Compare Source
Bug Fixes
Features
ParseObject.fetch
(#7779) (315290d)postgresql
protocol in database URI (#7757) (caf4a23)Reverts
The following changes would formally require a major version increment (Parse Server 6.0), but given their low relevance they are released as part of this minor version increment (Parse Server 5.1).
v5.0.0
Compare Source
BREAKING CHANGES
databaseOptions.enableSchemaHooks: true
to enable this feature and keep the schema in sync across all instances. Failing to do so will cause a schema change to not propagate to other instances and re-syncing will only happen when these instances restart. The optionsenableSingleSchemaCache
andschemaCacheTTL
have been removed. To use this feature with MongoDB, a replica set cluster with change stream support is required. (Diamond Lewis, SebC) #7214400
and Parse Error105
(INVALID_KEY_NAME
). By default these keywords are:{_bsontype: "Code"}
,constructor
,__proto__
. If you are using any of these keywords in your request data, you can override the default keywords by setting the new Parse Server optionrequestKeywordDenylist
to[]
and specify your own keywords as needed. (GHSA-p6h4-93qp-jhcm) (#7843) (971adb5)fileUpload
parameter in the Parse Server Options (dblythy, Manuel Trezza) #7071Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.